package com.ruoyi.zhjd.laboratory.modules.tensionProcess.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.zhjd.laboratory.modules.tensionProcess.entity.TensionProcess;
import com.ruoyi.zhjd.laboratory.modules.tensionProcess.mapper.LTensionProcessMapper;
import com.ruoyi.zhjd.laboratory.modules.tensionProcess.service.LTensionProcessService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * (TensionProcess)表服务实现类
 *
 * @author makejava
 * @since 2023-07-13 10:44:55
 */
@AllArgsConstructor
@Service("tensionProcessService")
public class LTensionProcessServiceImpl extends ServiceImpl<LTensionProcessMapper, TensionProcess> implements LTensionProcessService {

//    @Autowired
//    private BaseServiceComponent baseServiceComponent;

    @Override
    public IPage<TensionProcess> page(Map<String, Object> params) {
//        IPage<TensionProcess> page = baseServiceComponent.getPage(params, TensionProcess.class);
        return baseMapper.query(null, params);
    }

    /**
     * 新增
     *
     * @param tensionProcess
     */
    @Override
    public void insertTensionProcess(TensionProcess tensionProcess) {
        tensionProcess.setId(IdWorker.get32UUID());
        //创建者
//        tensionProcess.setCreateBy(SecurityUser.getUserId() == null ? null : SecurityUser.getUserId());
        //创建时间
//        tensionProcess.setCreateTime(DateUtils.getDate("yyyy-MM-dd HH:mm:ss"));
        save(tensionProcess);
    }

    /**
     * 修改
     *
     * @param tensionProcess
     */
    @Override
    public void updateTensionProcess(TensionProcess tensionProcess) {
        //修改者
//        tensionProcess.setUpdateBy(SecurityUser.getUserId() == null ? null : SecurityUser.getUserId());
        //修改时间
//        tensionProcess.setUpdateTime(DateUtils.getDate("yyyy-MM-dd HH:mm:ss"));
        updateById(tensionProcess);
    }

    @Override
    public void deleteByIds(List<String> ids) {
        removeByIds(ids);
    }
}

